/**
 * Created by Tsuna Chenug on 2016/12/7.
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    Navigator,
    View,
    TouchableOpacity,
    Image,
    Text
} from 'react-native';
export default class Header extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <View style={headerStyles.header}>
                <TouchableOpacity onPress={this.props.function}>
                    <Image style={headerStyles.header_Img} source={require('../Images/返回.png')}/>
                </TouchableOpacity>

                <View style={headerStyles.title}>
                    <Text style={headerStyles.header_text}>
                        {this.props.name}
                    </Text>
                </View>
            </View>
        );
    }
}

const headerStyles = StyleSheet.create({
    header: {
        flexDirection: 'row',
        flex: 1,
        backgroundColor: "#2E7CDE",
        alignItems: 'center'
    },
    header_Img: {
        width: 20,
        height: 35,
        marginLeft: 10
    },
    title: {
        flex: 1,
        alignItems: 'center',
        marginRight: 30
    },
    header_text: {
        fontSize: 30,
        color: '#ffffff'
    }

});
